import request from 'utils/request';

// 上传图片
export const uploadImage = (file: File) => {
  const formData = new FormData();
  formData.append('file', file);
  
  return request.post('/upload/image', formData, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
};

// 删除图片
export const deleteImage = (url: string) => {
  return request.delete('/upload/image', { data: { url } });
};

// 获取图片列表
export const getImageList = (params?: { page: number; size: number }) => {
  return request.get('/upload/images', { params });
};
